package main

import (
	"net/http"

	"github.com/gin-gonic/gin"
	"my.com/mygo/controllers"
	"my.com/mygo/services/auth"
)

// RegisterRouters 注册API
func RegisterRouters(router *gin.Engine) {

	router.GET("/ping", ping)

	auth := &auth.BasicAuthService{}
	v1 := router.Group("/api/v1", auth.BasicAuth())
	controllers.RegisterSystem(v1)
}

// Ping ping/pong
func ping(c *gin.Context) {
	c.JSON(http.StatusOK, "pong")
}
